home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 273_01 / strip.cc < prev    next >
Text File  |  1987-09-26  |  284b  |  17 lines

  1. strip(char *str, char c)
  2. /* This will string all occurances of char c out of string pointed to by *str */
  3. {
  4.    char *newstr;
  5.  
  6.    newstr = str;
  7.    while (*str) {
  8.     if (*str != c) {
  9.         *newstr=*str;
  10.         newstr++;
  11.         str++;
  12.       }
  13.     else str++;
  14.     }
  15.    *newstr = '\0';
  16. }
  17.